class UserNameErrorExecption extends RuntimeException {
    public UserNameErrorExecption(String message) {
        super(message);
    }
}
class PasswordErrorException extends RuntimeException {
    public PasswordErrorException(String message) {
        super(message);
    }
}
class LogIn {
    private String userName = "admin";
    private String password = "123456";

    public  void loginInfo(String userName, String password) throws UserNameErrorExecption, PasswordErrorException{
        if (!this.userName.equals(userName)) {
            //System.out.println("用户名错误！");
            throw new UserNameErrorExecption("我是用户名错误的异常的参数");
        }

        if(!this.password.equals(password)) {
            //System.out.println("密码错误！");
            throw new PasswordErrorException("我是密码错误的异常的参数");
            //return;
        }

        System.out.println("登陆成功");
    }
    public static void main(String[] args) {
        try {
            LogIn logIn = new LogIn();
            logIn.loginInfo("admin", "1234567");
        }catch (UserNameErrorExecption errorExecption) {
            errorExecption.printStackTrace();
            System.out.println("用户名异常！");
        }catch (PasswordErrorException e){
            e.printStackTrace();
            System.out.println("密码异常！");
        }
    }
}